package com.hspedu.newData.dmsxl.数组.二分查找;

import java.util.Arrays;

/**
 * @Author: yh
 * @description: 
 * @CreateTime: 2025-05-12 
 * @Version: 1.0
 */

public class LC268丢失的数字 {

    public int missingNumber(int[] nums) {


        Arrays.sort(nums);
        for (int i = 0; i < nums.length; i++) {
            if (nums[i] != i){
                return i;
            }
        }
        return nums.length;
    }
}
